package com.ny.demo5153;
public class Emp {
//    员工工号  姓名  年龄
    private String number;
    private String name;
    private int age;
//  创建set get方法
    public String getNumber() {
        return number;
    }
    public void setNumber(String number) {
        this.number = number;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
//   toString 方法。直接输出对象名就可以获取到所有成员变量的数据
    @Override
    public String toString() {
        return "Emp{" +
                "number='" + number + '\'' +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
